import { toRefs, reactive,onMounted } from 'vue';
import axios from "axios";

function MusicHook(){
    const state = reactive({
        musics: [],
      });
      onMounted(() => {
        axios.get("http://122.112.161.135:3000/top/album").then((res) => {
        state.musics = res.data.albums;
        });
      });
      const refState = toRefs(state);
      return refState
}
export default MusicHook